package com.privatework.common.converter;

import com.privatework.common.entity.leave.LeaveInfo;
import com.privatework.common.entity.user.UserEntity;
import com.privatework.common.requestvo.leave.LeaveInfoReqVo;
import com.privatework.common.requestvo.system.UserReqVo;
import com.privatework.common.vo.leave.LeaveInfoResultVo;
import com.privatework.common.vo.system.UserResultVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface LeaveInfoConverter {

    LeaveInfoConverter INSTANCE = Mappers.getMapper(LeaveInfoConverter.class);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    LeaveInfoResultVo domain2vo(LeaveInfo leaveInfo);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    LeaveInfo vo2domain(LeaveInfoReqVo leaveInfoReqVo);
}